<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
</head>

<body>
    <header class="aui-bar aui-bar-nav" style="background-color: #03a9f4;position:fixed;" id="header">
        <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" id="title">
            库存现存量-库转
        </div>
    </header>
    <div class="aui-content aui-margin-b-15" style="margin-top:50px;">
        <ul class="aui-list aui-form-list">
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">仓库</div>
                    <div class="aui-list-item-input">
                        <input type="text" placeholder="选择/扫描 仓库" id="workCenterCode" value=""
                            onclick="getIdSelector();" />
                    </div>
                    <i class="aui-input-addon aui-iconfont aui-icon-right" onclick="goSelectWorkCenter('1')"></i>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">库位</div>
                    <div class="aui-list-item-input">
                        <input type="text" placeholder="选择/扫描 库位" id="workCellCode" value=""
                            onclick="getIdSelector();" />
                    </div>
                    <i class="aui-input-addon aui-iconfont aui-icon-right" onclick="goSelectWorkCell('1')"></i>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">物料号</div>
                    <div class="aui-list-item-input">
                        <input type="text" id="mrlCode" disabled="true">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">批次号</div>
                    <div class="aui-list-item-input">
                        <input type="text" id="lotCode" disabled="true">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">现有量</div>
                    <div class="aui-list-item-input">
                        <input type="text" id="nowQty" disabled="true">
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">目标仓库</div>
                    <div class="aui-list-item-input">
                        <input type="text" placeholder="选择/扫描 仓库" id="relWorkCenterCode" value=""
                            onclick="getIdSelector();" />
                    </div>
                    <i class="aui-input-addon aui-iconfont aui-icon-right" onclick="goSelectWorkCenter('2')"></i>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">目标库位</div>
                    <div class="aui-list-item-input">
                        <input type="text" placeholder="选择/扫描 库位" id="relWorkCellCode" value=""
                            onclick="getIdSelector();" />
                    </div>
                    <i class="aui-input-addon aui-iconfont aui-icon-right" onclick="goSelectWorkCell('2')"></i>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">转移数量</div>
                    <div class="aui-list-item-input">
                        <input type="number" id="qty" placeholder="输入 数量">
                    </div>
                </div>
            </li>
        </ul>
        <div style="width:100%;margin-top:2%;"></div>
        <div class="aui-btn aui-btn-info aui-btn-block" onclick="doSearch()">查询</div>
        <div style="width:100%;margin-top:2%;"></div>
        <div class="aui-btn aui-btn-info aui-btn-block" onclick="move()">库转</div>
        <div style="background-color:white; height: 100%;width: 100%;margin-top:2%;margin-bottom: 12%;">
            <table class="table" style='width:100%;' id="table">
                <thead>
                    <tr
                        style="text-align: center;background-color: #DCE9F2;color: #467aa7;font-size: 12px;font-weight: bold;">
                        <td algin='center'></td>
                        <!-- <td algin='center'>序号</td> -->
                        <td algin='center'>物料号</td>
                        <td algin='center'>物料名</td>
                        <td algin='center'>批次号</td>
                        <td algin='center'>现有数</td>
                        <!-- <td algin='center'>冻结数</td> -->
                        <td algin='center'>仓库编码</td>
                        <td algin='center'>库位编码</td>
                        <!-- <td style="display:none;">物料名称</td> -->
                        <td style="display:none;">规格型号</td>
                        <td algin='center'>单位</td>
                    </tr>
                </thead>
                <tbody id="tbodyHtml">
                </tbody>
            </table>
        </div>
    </div>

    <footer class="aui-bar aui-bar-tab" id="footer">
        <div class="aui-bar-tab-item" tapmode id="scan" onclick="doScan()">
            <i class="aui-iconfont aui-icon-scan aui-text-epblue" style="font-size: 1.8rem"></i>
        </div>
    </footer>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../script/public.js"></script>
<script type="text/javascript">
    //光标所在id
    var idSelector = "";
    var workCenterGid = ""; //仓库GID
    var mrlId = "";
    var mrlCode = "";
    var mrlName = "";
    var workCenterCode = ""; //仓库编码
    var workCenterName = ""; //仓库名称
    var workCellGid = ""; //库位GID
    var workCellCode = ""; //库位编码
    var workCellName = ""; //库位名称
    var relWorkCellGid = ""; //目标库位GID
    var relWorkCellCode = ""; //目标库位编码
    var relWorkCellName = ""; //目标库位名称
    var relWorkCenterGid = ""; //目标仓库GID
    var relWorkCenterCode = ""; //目标仓库编码
    var relWorkCenterName = ""; //目标仓库名称

    var workCenterSelectFlag = ""; //仓库选择事件
    var workCellSelectFlag = ""; //库位选择事件

    //初始化
    apiready = function () {
        $("#workCenterCode").focus();
        idSelector = "workCenterCode";

    }

    // 获取光标所在组件的id
    function getIdSelector() {
        var e = event || window.event;
        var el = e.srcElement || e.target;
        idSelector = el.id;
        $("#" + el.id).select();
    }

    //扫描
    function doScan() {
        var moduleScanner = api.require('moduleScanner');
        var params = {
            top: 150, //扫描窗口的上边距
            width: 250, //扫描窗口的宽
            height: 250, //扫描窗口的高
            useColor: false, //是否使用自己设定的颜色(startColor和endColor),
            //如果不使用设定的颜色就使用默认的那张网格图
            startColor: '#0F08C8FF', //渐变起始颜色
            endColor: '#7F08C8FF', //渐变结束颜色
            animTime: 2200, //扫描动画时间,单位为毫秒
        };
        moduleScanner.toScannerActivityForResult(params, function (ret, err) {
            //alert(ret);扫码的结果都是编码
            //1：来源仓库
            if (idSelector == 'workCenterCode') {

                $("#workCenterCode").val(ret);
                //查询仓库
                getWorkCenter(ret, idSelector, "1");

                //2:来源库位
            } else if (idSelector == 'workCellCode') {

                $("#workCellCode").val(ret);
                //查询来源库位
                getWorkCell(ret, idSelector, "1");

                //3：目标仓库
            } else if (idSelector == 'relWorkCenterCode') {

                $("#relWorkCenterCode").val(ret);
                //查询仓库
                getWorkCenter(ret, idSelector, "2");

                //4：目标库位
            } else if (idSelector == 'relWorkCellCode') {

                $("#relWorkCellCode").val(ret);
                //查询目标库位
                getWorkCell(ret, idSelector, "2");

                //5：扫描物料号
            } else if (idSelector == 'mrlCode') {

                $("#mrlCode").val(ret);
                getMrl(ret, idSelector);
            }

        });
    }

    //1：仓库扫描校验
    function getWorkCenter(code, inputId, workCenterFlag) {
        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getWorkCenter";
        var data = {
            values: {
                un: un,
                workCenterCode: code,
                mrlCode: "",
                lotCode: "",
                qty: ""
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                //成功
                if (myobj.code == '0') {

                    var list = eval(myobj.list);
                    if (list.length > 0) {

                        //源仓库
                        if (workCenterFlag == "1") {
                            workCenterGid = list[0].workCenterGid;
                            workCenterCode = list[0].workCenterCode + ":" + list[0].workCenterName;
                            workCenterName = list[0].workCenterName;
                            document.getElementById(inputId).value = workCenterCode;

                            //目标仓库
                        } else {
                            relWorkCenterGid = list[0].workCenterGid;
                            relWorkCenterCode = list[0].workCenterCode + ":" + list[0].workCenterName;
                            relWorkCenterName = list[0].workCenterName;
                            document.getElementById(inputId).value = relWorkCenterCode;
                        }

                    } else {

                        //源仓库
                        if (workCenterFlag == "1") {
                            workCenterGid = "";
                            workCenterCode = "";
                            workCenterName = "";
                            document.getElementById(inputId).value = workCenterCode;

                            //目标仓库
                        } else {
                            relWorkCenterGid = "";
                            relWorkCenterCode = "";
                            relWorkCenterName = "";
                            document.getElementById(inputId).value = relWorkCenterCode;
                        }

                        api.toast({
                            msg: "仓库编码【" + code + "】不存在!",
                            duration: 3000
                        });
                    }
                } else {
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }

    //2：选中仓库
    function goSelectWorkCenter(workCenterFlag) {
        workCenterSelectFlag = workCenterFlag;
        api.openWin({
            name: 'uwmSelectWorkCenter',
            url: 'uwmSelectWorkCenter.html',
            pageParam: {
                flag: "in",
                name: "uwmStock_move",
                mrlCode: "",
                lotCode: "",
                qty: ""
            }
        });
    }

    //3:仓库选择后回调函数
    function setWorkCenter(id, code, name) {
        if (workCenterSelectFlag == "1") {
            workCenterGid = id;
            workCenterCode = code;
            workCenterName = name;
            document.getElementById('workCenterCode').value = code + ":" + name;
        } else if (workCenterSelectFlag == "2") {
            relWorkCenterGid = id;
            relWorkCenterCode = code;
            relWorkCenterName = name;
            document.getElementById('relWorkCenterCode').value = code + ":" + name;
        }
    }

    //4:来源仓库PDA自带扫描回车事件
    $("#workCenterCode").on('keypress', function (e) {
        var keycode = e.keyCode;
        var sm = $(this).val();
        if (keycode == '13') {

            //仓库编码
            $("#workCenterCode").val(sm);
            //校验仓库编码是否存在
            getWorkCenter(sm, "workCenterCode", "1");
        }
    });

    //5:目标仓库PDA自带扫描回车事件
    $("#relWorkCenterCode").on('keypress', function (e) {
        var keycode = e.keyCode;
        var sm = $(this).val();
        if (keycode == '13') {

            //仓库编码
            $("#relWorkCenterCode").val(sm);
            //校验仓库编码是否存在
            getWorkCenter(sm, "relWorkCenterCode", "2");
        }
    });

    //7:库位扫描校验
    function getWorkCell(code, inputId, flag) {

        var id = "";
        //源库位扫描前先扫来源仓库
        if (inputId == "workCellCode") {
            var workCenterCodeR = $("#workCenterCode").val();
            if (workCenterGid == "" || workCenterGid == null || workCenterGid == undefined) {
                api.toast({
                    msg: "请先选择/扫描 来源仓库",
                    duration: 3000
                });
                $("#workCellCode").val("");
                workCellCode = "";
                workCellGid = "";
                workCellName = "";
                return;
            }

            if (workCenterCodeR == "" || workCenterCodeR == null || workCenterCodeR == undefined) {
                api.toast({
                    msg: "请先选择/扫描 来源仓库",
                    duration: 3000
                });
                $("#workCellCode").val("");
                workCellCode = "";
                workCellGid = "";
                workCellName = "";
                return;
            }

            id = workCenterGid;

            //目标
        } else {
            var relWorkCenterCodeR = $("#relWorkCenterCode").val();
            if (relWorkCenterGid == "" || relWorkCenterGid == null || relWorkCenterGid == undefined) {
                api.toast({
                    msg: "请先选择/扫描 目标仓库",
                    duration: 3000
                });
                $("#workCellCode").val("");
                workCellCode = "";
                workCellGid = "";
                workCellName = "";
                return;
            }

            if (relWorkCenterCodeR == "" || relWorkCenterCodeR == null || relWorkCenterCodeR == undefined) {
                api.toast({
                    msg: "请先选择/扫描 目标仓库",
                    duration: 3000
                });
                $("#relWorkCellCode").val("");
                relWorkCellCode = "";
                relWorkCellGid = "";
                relWorkCellName = "";
                return;
            }
            id = relWorkCenterGid;
        }

        var un = localStorage.getItem("un");
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getWorkCell";
        var data = {
            values: {
                flag: "in_rk", //库内库间标识（out_kn库内  out_kj库间,in_rk入库出库）
                workCenterGid: id, //仓库GID
                workCellCode: code, //库位编码
                relWorkCellGid: "", //目标库位
                tm: "",
                workCellFlag: "", //原库位目标库位flag
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                //成功
                if (myobj.code == '0') {
                    var list = eval(myobj.list);

                    //源库位
                    if (flag == "1") {

                        if (list.length > 0) {
                            workCellGid = list[0].workCellGid;
                            workCellCode = list[0].workCellCode + ":" + list[0].workCellName;
                            workCellName = list[0].workCellName;
                            document.getElementById(inputId).value = workCellCode;
                        } else {
                            workCellGid = "";
                            workCellCode = "";
                            workCellName = "";
                            document.getElementById(inputId).value = workCellCode;

                            api.toast({
                                msg: "库位编码【" + code + "】不存在!",
                                duration: 3000
                            });
                        }

                        //目标库位
                    } else if (flag == "2") {
                        if (list.length > 0) {
                            relWorkCellGid = list[0].workCellGid;
                            relWorkCellCode = list[0].workCellCode + ":" + list[0].workCellName;
                            relWorkCellName = list[0].workCellName;
                            document.getElementById(inputId).value = relWorkCellCode;
                        } else {
                            relWorkCellGid = "";
                            relWorkCellCode = "";
                            relWorkCellName = "";
                            document.getElementById(inputId).value = relWorkCellCode;

                            api.toast({
                                msg: "库位编码【" + code + "】不存在!",
                                duration: 3000
                            });
                        }
                    }
                } else {
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }

    //8：选择库位
    function goSelectWorkCell(workCellFlag) {
        workCellSelectFlag = workCellFlag;
        var id = "";

        //来源仓库
        if (workCellFlag == "1") {
            var workCenterCodeR = $("#workCenterCode").val();
            //来源仓库非空校验
            if (workCenterGid == "" || workCenterGid == null || workCenterGid == undefined) {
                api.toast({
                    msg: "请先选择/扫描 来源仓库",
                    duration: 3000
                });
                return;
            }

            //来源仓库非空校验
            if (workCenterCodeR == "" || workCenterCodeR == null || workCenterCodeR == undefined) {
                api.toast({
                    msg: "请先选择/扫描 来源仓库",
                    duration: 3000
                });
                return;
            }

            id = workCenterGid;

            //目标仓库
        } else {
            var relWorkCenterCodeR = $("#relWorkCenterCode").val();
            //目标仓库非空校验
            if (relWorkCenterGid == "" || relWorkCenterGid == null || relWorkCenterGid == undefined) {
                api.toast({
                    msg: "请先选择/扫描 仓库",
                    duration: 3000
                });
                return;
            }

            //目标仓库非空校验
            if (relWorkCenterCodeR == "" || relWorkCenterCodeR == null || relWorkCenterCodeR == undefined) {
                api.toast({
                    msg: "请先选择/扫描 目标仓库",
                    duration: 3000
                });
                return;
            }
            id = relWorkCenterGid;
        }

        api.openWin({
            name: 'uwmSelectWorkCell',
            url: 'uwmSelectWorkCell.html',
            pageParam: {
                flag: "in_rk",
                name: "uwmStock_move",
                tm: "",
                workCenterGid: id,
                relWorkCellGid: "",
                workCellFlag: ""
            }
        });
    }

    //库位选择后回调函数
    function setWorkCell(id, code, name) {

        if (workCellSelectFlag == "1") {

            workCellGid = id;
            workCellCode = code;
            workCellName = name;
            document.getElementById('workCellCode').value = code + ":" + name;

        } else {
            relWorkCellGid = id;
            relWorkCellCode = code;
            relWorkCellName = name;
            document.getElementById('relWorkCellCode').value = code + ":" + name;
        }
    }

    //9；PDA自带扫描回车事件-源库位
    $("#workCellCode").on('keypress', function (e) { //#keyword为input文本框
        var keycode = e.keyCode;
        var sm = $(this).val();
        if (keycode == '13') {

            $("#workCellCode").val(sm);
            getWorkCell(sm, "workCellCode", "1");
        }
    });

    //10；PDA自带扫描回车事件-目标库位
    $("#relWorkCellCode").on('keypress', function (e) { //#keyword为input文本框
        var keycode = e.keyCode;
        var sm = $(this).val();
        if (keycode == '13') {

            $("#relWorkCellCode").val(sm);
            getWorkCell(sm, "relWorkCellCode", "2");
        }
    });

    //6：选择物料
    function goSelectMrl() {
        api.openWin({
            name: 'uwmSelectMrl',
            url: 'uwmSelectMrl.html',
            pageParam: {
                name: "uwmStock_move"
            }
        });
    }

    //物料选择后回调函数
    function setMrl(id, code, name) {
        mrlId = id;
        mrlCode = code;
        mrlName = name;
        document.getElementById('mrlCode').value = code + ":" + name;
        console.log(mrlCode)
    }
    //3；PDA自带扫描回车事件
    $("#workCenterCode").on('keypress', function (e) { //#keyword为input文本框
        var keycode = e.keyCode;
        var sm = $(this).val();
        if (keycode == '13') {
            //仓库编码
            $("#workCenterCode").val(sm);
            // console.log("扫描回车事件：" + sm);
            //校验改箱码是否存在
            getWorkCenter(sm, "workCenterCode");
        }
    });

    //查询
    function doSearch() {

        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/doSearchStock";
        var data = {
            values: {
                workCenterGid: workCenterGid,
                workCellGid: workCellGid,
                mrlCode: mrlCode,
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");

                //返回成功
                if (myobj.code == "0") {
                    var list = eval(myobj.list);
                    var html = "";
                    for (var i = 0; i < list.length; i++) {
                        if (list[i].measureName == null || list[i].measureName == "null") {
                            list[i].measureName = ""
                        }
                        html += "<tr style='text-align: center;color: black;font-size: 12px;background-color: #F5F5F5;'>";
                        html += "<td style='width:40px;'><input name='sub' type='radio' onchange='selectChange()'/></td>";
                        // html += "<td name='seqno'>" + (i + 1) + "</td>";
                        html += "<td name='mrlCode'>" + list[i].mrlCode + "</td>";
                        html += "<td name='mrlName'>" + list[i].mrlName + "</td>";
                        html += "<td name='lotCode'>" + list[i].lotCode + "</td>";
                        html += "<td name='qty'>" + list[i].qty + "</td>";
                        // html += "<td name='frezzQty'>" + list[i].frezzQty + "</td>";
                        html += "<td name='workCenterCode'>" + list[i].workCenterCode + "</td>";
                        html += "<td name='workCellCode'>" + list[i].workCellCode + "</td>";
                        //html += "<td name='measureName'>" + list[i].measureName == null? " " : list[i].measureName + "</td>";
                        //html += "<td name='mrlName' style='display:none;'>" + list[i].mrlName + "</td>";
                        html += "<td name='specification' style='display:none;'>" + list[i].specification + "</td>";
                        html += "<td name='measureName'>" + list[i].measureName + "</td>";
                        html += "</tr>";
                    }
                    $api.html($api.byId("tbodyHtml"), html);

                    //失败
                } else if (myobj.code == "1") {

                    //清空表格数据
                    $api.html($api.byId("tbodyHtml"), "");
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }

    //库转
    function move() {
        //转移数量
        var qty = $("#qty").val();

        //目标库位非空校验
        if (relWorkCellGid == "" || relWorkCellGid == null || relWorkCellGid == undefined) {
            api.toast({
                msg: '请选择/扫描 目标库位',
                duration: 3000
            });
            return;
        }

        //转移数量非空校验
        if (qty == "" || qty == null || qty == undefined) {
            api.toast({
                msg: '请输入转移数量',
                duration: 3000
            });
            return;
        } else {
            if (parseFloat(qty) <= 0) {
                api.toast({
                    msg: '转移数量必须大于0',
                    duration: 3000
                });
                return;
            }
        }
        //选中数据
        var check = $("input[type='radio']:checked"); //在table中找input下类型为radio属性为选中状态的数据
        var count = 0;
        check.each(function () {
            count++;
        });
        //选中行不为1
        if (count == 0) {
            api.toast({
                msg: '请选择一条数据！',
                duration: 3000
            });
            return;
        }
        var mrlCode = "";
        var mrlName = "";
        var lotCode = "";
        var workCenterCode1 = "";
        var workCellCode1 = "";

        check.each(function () { //遍历
            var row = $(this).parent("td").parent("tr");
            mrlCode = row.find("[name='mrlCode']").html();
            mrlName = row.find("[name='mrlName']").html();
            lotCode = row.find("[name='lotCode']").html();
            workCenterCode1 = row.find("[name='workCenterCode']").html();
            workCellCode1 = row.find("[name='workCellCode']").html();
        });

        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');

        var url = serverUrl + "/app/doMoveStock";
        var data = {
            values: {
                workCenterCode: workCenterCode1,
                workCellCode: workCellCode1,
                mrlCode: mrlCode,
                lotCode: lotCode,
                qty: qty,
                relworkCenterCode: relWorkCenterCode,
                relworkCellCode: relWorkCellCode,
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");

                //返回成功
                if (myobj.code == "0") {
                    api.hideProgress();
                    api.toast({
                        msg: "保存成功",
                        duration: 3000
                    });

                }
                //失败
            } else if (myobj.code == "1") {

                //清空表格数据
                $api.html($api.byId("tbodyHtml"), "");
                api.toast({
                    msg: myobj.message,
                    duration: 3000
                });
            }

        });
    }

    //选择时带回信息
    function selectChange() {
        var check = $("input[type='radio']:checked");
        console.log(check);
        var workCenterCode1 = "";
        var workCellCode1 = "";

        check.each(function () { //遍历
            var row = $(this).parent("td").parent("tr");
            $("#mrlCode").val(row.find("[name='mrlCode']").html());
            $("#lotCode").val(row.find("[name='lotCode']").html());
            $("#nowQty").val(row.find("[name='qty']").html());
            workCenterCode1 = row.find("[name='workCenterCode']").html();
            workCellCode1 = row.find("[name='workCellCode']").html();
        });

        getWorkCenter(workCenterCode1, "workCenterCode", "1");
        getWorkCell(workCellCode1, "workCellCode", "1");
    }

    //订单返回按钮
    function closeWin() {
        api.closeWin({});
    }

</script>

</html>